import Cookies from "js-cookie";

const TokenKey = "ITG-token"; // token
const UserInfoKey = "ITG-UserInfo"; // 用户信息

/* 存取token */
export function getToken () { return Cookies.get(TokenKey); }
export function setToken (token) { return Cookies.set(TokenKey, token); }
export function removeToken () { return Cookies.remove(TokenKey); }

/* 缓存、获取用户信息 */
export function setUserInfo (userInfo) {
  return localStorage.setItem(UserInfoKey, userInfo);
}
export function getUserInfo () {
  return localStorage.getItem(UserInfoKey);
}
